package com.zzyl.mapper;

import com.aliyun.iot20180120.models.QueryDevicePropertyStatusRequest;
import com.github.pagehelper.Page;
import com.zzyl.entity.DeviceData;
import com.zzyl.vo.DeviceDataGraphVo;
import com.zzyl.vo.DeviceDataVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface DeviceDataMapper {

    void insert(List<DeviceDataVo> deviceData);

    Page<DeviceDataVo> list(@Param("deviceName") String deviceName,
                            @Param("startDate") LocalDateTime startDate,
                            @Param("endDate") LocalDateTime endDate,
                            @Param("functionId") String functionId);


    List<DeviceDataGraphVo> queryDeviceDataListByDay(String iotId, String functionId, LocalDateTime startTime, LocalDateTime endTime);

    List<DeviceDataGraphVo> queryDeviceDataListByWeek(String iotId, String functionId, LocalDateTime startTime, LocalDateTime endTime);

    void batchInsert(List<DeviceData> deviceData);
}
